home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / makefile < prev    next >
Makefile  |  1996-11-13  |  6KB  |  196 lines

  1. # $Id: makefile,v 1.34 1996/11/13 14:10:37 aros Exp $
  2. TOP=.
  3. CURDIR=.
  4.  
  5. SPECIAL_CFLAGS = -Dmain=submain
  6.  
  7. include $(TOP)/config/make.cfg
  8.  
  9. DEP_LIBS= $(LIBDIR)/libAmigaOS.a \
  10.     $(GENDIR)/filesys/emul_handler.o \
  11.     $(LIBDIR)/libaros.a
  12.  
  13. LIBS=-L$(LIBDIR) \
  14.     $(GENDIR)/filesys/emul_handler.o -lAmigaOS -laros
  15.  
  16. SUBDIRS = config \
  17.     include aros clib exec dos utility graphics intuition \
  18.     alib filesys libs devs c Demos
  19.  
  20. # Extra files which should go in the developer dist
  21. DIST_FILES = \
  22.     .cvsignore \
  23.     AFD-COPYRIGHT \
  24.     arosshell.c \
  25.     BUGS \
  26.     configure \
  27.     crypt.c \
  28.     makefile \
  29.     README* \
  30.     CVS \
  31.     s/CVS \
  32.     s/Startup-Sequence \
  33.     scripts/CVS \
  34.     scripts/checkmem.awk \
  35.     scripts/cint2.awk \
  36.     scripts/copyright.awk \
  37.     scripts/gendef.awk \
  38.     scripts/genprotos.h \
  39.     scripts/jobclient.awk \
  40.     scripts/makefunctable.awk \
  41.     scripts/makelinks \
  42.     scripts/purify \
  43.     scripts/purify.awk \
  44.     scripts/relpath \
  45.     scripts/stat.awk
  46.  
  47. TESTDIR = $(BINDIR)/test
  48. TESTS = $(TESTDIR)/tasktest \
  49.     $(TESTDIR)/signaltest \
  50.     $(TESTDIR)/exceptiontest \
  51.     $(TESTDIR)/tasktest2 \
  52.     $(TESTDIR)/messagetest \
  53.     $(TESTDIR)/semaphoretest \
  54.     $(TESTDIR)/initstructtest \
  55.     $(TESTDIR)/devicetest \
  56.     $(TESTDIR)/filetest
  57.  
  58. all : setup subdirs AmigaOS \
  59.         $(BINDIR)/s/Startup-Sequence $(BINDIR)/arosshell
  60.  
  61. crypt : crypt.c
  62.     $(CC) -o crypt crypt.c
  63.  
  64. dist : dist-dir dist-tar dist-lha
  65.     cp README dist/AROSbin-$(VERSION).readme
  66.     cp README dist/AROSdev-$(VERSION).readme
  67.  
  68. dist-dir : FORCE
  69.     @if [ ! -d dist ]; then $(MKDIR) dist ; else true ; fi
  70.  
  71. dist-tar : FORCE
  72.     cd bin/$(ARCH) ; \
  73.         $(RM) ../../dist/AROSbin-$(VERSION).tgz ; \
  74.         tar chvzf ../../dist/AROSbin-$(VERSION).tgz AROS
  75.     cd .. ; \
  76.         $(RM) AROS/dist/AROSdev-$(VERSION).tgz ; \
  77.         tar cvzf AROS/dist/AROSdev-$(VERSION).tgz \
  78.         $(addprefix AROS/, $(sort $(SUBDIRS) $(DIST_FILES))) \
  79.         $(shell cd ..; find AROS/include -name "*.h")
  80.  
  81. dist-lha : FORCE
  82.     cd bin/$(ARCH) ; \
  83.         $(RM) ../../dist/AROSbin-$(VERSION).lha ; \
  84.         lha a ../../dist/AROSbin-$(VERSION).lha AROS
  85.     cd .. ; \
  86.         $(RM) AROS/dist/AROSdev-$(VERSION).lha ; \
  87.         lha a AROS/dist/AROSdev-$(VERSION).lha \
  88.         $(addprefix AROS/, $(sort $(SUBDIRS) $(DIST_FILES))) \
  89.         $(shell cd ..; find AROS/include -name "*.h")
  90.  
  91. # Alwaye remake rules that depend on this one
  92. FORCE :
  93.  
  94. setup :
  95.     @if [ ! -d amiga/include ]; then \
  96.         echo "Missing AmigaOS includes. Please get a copy and put" ; \
  97.         echo "them into amiga/include." ; \
  98.         exit 10 ; \
  99.     else true ; fi
  100.     @if [ ! -d bin ]; then $(MKDIR) bin ; else true ; fi
  101.     @if [ ! -d bin/$(ARCH) ]; then $(MKDIR) bin/$(ARCH) ; else true ; fi
  102.     @if [ ! -d $(BINDIR) ]; then $(MKDIR) $(BINDIR) ; else true ; fi
  103.     @if [ ! -d $(SDIR) ]; then $(MKDIR) $(SDIR) ; else true ; fi
  104.     @if [ ! -d $(EXEDIR) ]; then $(MKDIR) $(EXEDIR) ; else true ; fi
  105.     @if [ ! -d $(LIBDIR) ]; then $(MKDIR) $(LIBDIR) ; else true ; fi
  106.     @if [ ! -d $(DEVSDIR) ]; then $(MKDIR) $(DEVSDIR) ; else true ; fi
  107.     @if [ ! -d $(SLIBDIR) ]; then $(MKDIR) $(SLIBDIR) ; else true ; fi
  108.     @if [ ! -d $(TESTDIR) ]; then $(MKDIR) $(TESTDIR) ; else true ; fi
  109.     @if [ ! -d $(GENDIR) ]; then $(MKDIR) $(GENDIR) ; else true ; fi
  110.     @if [ ! -d $(GENDIR)/test ]; then $(MKDIR) $(GENDIR)/test ; else true ; fi
  111.     @if [ ! -d $(GENDIR)/filesys ]; then $(MKDIR) $(GENDIR)/filesys ; else true ; fi
  112.  
  113. check : $(TESTS)
  114.     @for test in $(TESTS) ; do \
  115.         echo "Running test `basename $$test`" ; $$test ; \
  116.     done
  117.  
  118. clean:
  119.     $(RM) $(ARCHDIR) host.cfg
  120.     @for dir in $(SUBDIRS) ; do \
  121.         ( echo "Cleaning in $$dir..." ; cd $$dir ; \
  122.           $(MAKE) $(MFLAGS) TOP=".." CURDIR="$(CURDIR)/$$dir" \
  123.           clean ) ; \
  124.     done
  125.  
  126. $(BINDIR)/arosshell: $(GENDIR)/arosshell.o $(DEP_LIBS)
  127.     $(CC) $(CFLAGS) $< $(LIBS) $(X11LDFLAGS) -lX11 -o $@
  128.  
  129. subdirs:
  130.     @for dir in $(SUBDIRS) ; do \
  131.         echo "Making all in $$dir..." ; \
  132.         if ( cd $$dir ; \
  133.         $(MAKE) $(MFLAGS) TOP=".." CURDIR="$(CURDIR)/$$dir" \
  134.         all ) ; \
  135.         then echo -n ; else exit 1 ; fi ; \
  136.     done
  137.  
  138. # I have to restart make here since not all files might be existing
  139. # in $(OSGENDIR) at the time when make was started in the first place.
  140. AmigaOS :
  141.     $(MAKE) $(MFLAGS) $(LIBDIR)/libAmigaOS.a
  142.  
  143. $(LIBDIR)/libAmigaOS.a : $(wildcard $(OSGENDIR)/*.o) \
  144.         $(wildcard $(GENDIR)/alib/*.o)
  145.     $(AR) $@ $?
  146.     $(RANLIB) $@
  147.  
  148. $(SDIR)/Startup-Sequence : s/Startup-Sequence
  149.     $(CP) $^ $@
  150.  
  151. includes: include/clib/exec_protos.h \
  152.         include/clib/dos_protos.h \
  153.         include/clib/utility_protos.h \
  154.         include/clib/graphics_protos.h \
  155.         include/clib/intuition_protos.h \
  156.         include/clib/console_protos.h
  157.  
  158. include/clib/exec_protos.h: $(wildcard $(KERNEL)/*.s $(KERNEL)/*.c exec/*.c)
  159.     gawk -f scripts/genprotos.h --assign lib=Exec \
  160.     config/$(KERNEL)/*.s config/$(KERNEL)/*.c exec/*.c
  161.  
  162. include/clib/dos_protos.h: $(wildcard dos/*.c)
  163.     gawk -f scripts/genprotos.h --assign lib=Dos \
  164.     dos/*.c
  165.  
  166. include/clib/utility_protos.h: $(wildcard utility/*.c)
  167.     gawk -f scripts/genprotos.h --assign lib=Utility \
  168.     utility/*.c
  169.  
  170. include/clib/graphics_protos.h: $(wildcard graphics/*.c)
  171.     gawk -f scripts/genprotos.h --assign lib=Graphics \
  172.     graphics/*.c
  173.  
  174. include/clib/intuition_protos.h: $(wildcard intuition/*.c)
  175.     gawk -f scripts/genprotos.h --assign lib=Intuition \
  176.     intuition/*.c
  177.  
  178. include/clib/console_protos.h: devs/cdinputhandler.c devs/rawkeyconvert.c
  179.     gawk -f scripts/genprotos.h --assign lib=Console \
  180.     devs/cdinputhandler.c devs/rawkeyconvert.c
  181.  
  182. .FORCE:
  183.  
  184. $(GENDIR)/%.o: %.c
  185.     $(CC) $(CFLAGS) $< -c -o $@
  186.  
  187. #$(GENDIR)/%.d: %.c
  188. #     @$(RM) $@
  189. #     @touch $@
  190. #     @$(MKDEPEND) -f$@ -p$(GENDIR)/ -- $(CFLAGS) -- $^
  191. #
  192. #include $(GENDIR)/arosshell.d
  193.  
  194. cleandep:
  195.     $(RM) $(GENDIR)/*.d $(GENDIR)/*/*.d
  196.